﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Web.Services.Protocols;

namespace Utils
{
    public class CustomException : Exception
    {
        private string exceptionType;
        public string ExceptionType
        {
            get { return exceptionType ?? string.Empty; }
            set { exceptionType = value; }
        }

        public CustomException(string type)
            : base()
        {
            this.ExceptionType = type;
        }

        public CustomException(string message, string type)
            : base(message)
        {
            this.ExceptionType = type;
        }

        public CustomException(string message, Exception innerException, string type)
            : base(message, innerException)
        {
            this.ExceptionType = type;
        }
    }

    public class CustomTimeoutException : TimeoutException
    {
        private string exceptionType;
        public string ExceptionType
        {
            get { return exceptionType ?? string.Empty; }
            set { exceptionType = value; }
        }

        public CustomTimeoutException(string type)
            : base()
        {
            this.ExceptionType = type;
        }

        public CustomTimeoutException(string message, string type)
            : base(message)
        {
            this.ExceptionType = type;
        }

        public CustomTimeoutException(string message, Exception innerException, string type)
            : base(message, innerException)
        {
            this.ExceptionType = type;
        }
    }

    public class CustomWebException : WebException
    {
        private string exceptionType;
        public string ExceptionType
        {
            get { return exceptionType ?? string.Empty; }
            set { exceptionType = value; }
        }

        public CustomWebException(string type)
            : base()
        {
            this.ExceptionType = type;
        }

        public CustomWebException(string message, string type)
            : base(message)
        {
            this.ExceptionType = type;
        }

        public CustomWebException(string message, Exception innerException, string type)
            : base(message, innerException)
        {
            this.ExceptionType = type;
        }

        public CustomWebException(string message, WebExceptionStatus status, string type)
            : base(message, status)
        {
            this.ExceptionType = type;
        }

        public CustomWebException(string message, Exception innerException, WebExceptionStatus status, WebResponse response, string type)
            :base(message, innerException, status, response)
        {
            this.ExceptionType = type;
        }
    }

    public class CustomSoapException : SoapException
    {
        private string exceptionType;
        public string ExceptionType
        {
            get { return exceptionType ?? string.Empty; }
            set { exceptionType = value; }
        }

        public CustomSoapException(string type)
            : base()
        {
            this.ExceptionType = type;
        }
    }
}
